from .. import forms
from django.db import models

class WangEditorNextField(models.JSONField):
    def formfield(self, **kwargs):
        return super().formfield(
            **{
                "form_class": forms.WangEditorNextField,
                # Haven't find the code to add a second input element (hidden)
                # but the following line works to prevent add it
                "show_hidden_initial": False,
                **kwargs,
            }
        )
    
class YesNoField(models.BooleanField):
    def formfield(self, **kwargs):
        return super().formfield(
            **{
                "form_class": forms.YesNoField,
                **kwargs,
            }
        )
